<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>垂直居中</title>
    <style>
        .father {
            height: 300px;
            background-color: pink;
            width: 600px;
            line-height: 300px;
        }
        .son {
            background-color: palegreen;
            width: 100px;
            display: inline-block;
            vertical-align: middle;
            height: 100px;
        }
    </style>
</head>

<body>
    <div class="father">
        <div class="son">
        </div>
    </div>
</body>
</html>